/******************************************************************************/
package jamie.org.sil.www.usxUtils;

import java.util.Iterator;
import java.util.NoSuchElementException;


/******************************************************************************/
/**
 * An iterator which runs over all output files mentioned in the book
 * book assembly configuration file.
 * <p>
 * 
 * Note that this class interacts very closely with {@link BookAssembly}, qv.
 * 
 * @author Jamie
 */

public class BookAssemblyAllOutputFilesIterator implements Iterator<BookElement>
{
  public BookAssemblyAllOutputFilesIterator () {}

  @Override public boolean hasNext ()
  {
    int i = m_Ix + 1;
    return i < BookAssembly.instance().getBookElements().size();
  }
    
  @Override public BookElement next () throws NoSuchElementException
  {
    if (hasNext())
      return BookAssembly.instance().getBookElements().get(++m_Ix);
    else  
      throw new NoSuchElementException();
  }
    
  @Override public void remove () {}
   
  private int m_Ix = -1;
}
